package com.photoeditor.demo.model.share;

import android.net.Uri;

/**
 * 用于缓存当前分享的数据
 */
public class ShareImageCacheData {
	private int mPosition = -1;
	private Uri mUri = null;
	private String mPackageName = null;
	private String mActivityName = null;
	
	
	/**
	 * 检查合法性
	 * @param position
	 * @param u
	 * @return
	 */
	public boolean checkArgs(int position, Uri u){
		if(position == mPosition && mUri != null && mUri.equals(u) && mPackageName != null && mActivityName != null){
			return true;
		}
		return false;
	}
	
	/**
	 * 设置数据
	 * @param position
	 * @param u
	 * @param pkgName
	 * @param activityName
	 */
	public void setData(int position, Uri u, String pkgName, String activityName){
		mPosition = position;
		mUri = u;
		mPackageName = pkgName;
		mActivityName = activityName;
	}

	public Uri getmUri() {
		return mUri;
	}

	public String getmPackageName() {
		return mPackageName;
	}

	public String getmActivityName() {
		return mActivityName;
	}
	
	
}
